package com.common.db.service.impl;

import com.common.db.dao.UserDAO;
import com.common.db.model.UserVO;
import com.common.db.service.UserService;
import com.jd.components.annotation.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by cdyizuoming on 2017/3/16.
 */
@Repository
public class UserServiceImpl implements UserService {

    @Autowired
    UserDAO userDAO;

    @DataSource("read")
    public List<UserVO> findUsers() {
        return userDAO.findUsers();
    }

    @DataSource("write")
    public Integer addUser(UserVO userVO) {
        return userDAO.addUser(userVO);
    }
}
